// 读文件
var fs = require('fs');
fs.open('./textread.txt', 'r', function(err, fd) {
    if (err) {
        throw err;
    }

    console.log('打开文件');

    var buffer = new Buffer(255);
    fs.read(fd, buffer, 0, 9, 0, function(err, bytesRead, buffer) {
        if (err) {
            throw err;
        }
        console.log(bytesRead, buffer.slice(0, bytesRead).toString());
        fs.close(fd);
    });
});